package eureka.domain.account;

import java.io.Serializable;

import net.sf.json.JSON;
import net.sf.json.JSONSerializer;

/**
 * 
 * @author jinyi
 *
 */
public class AcceptableUser implements Serializable {

	private static final long serialVersionUID = 1L;

	private long auID;
	private String StaffID;
	private UserGender Gender;
	private UserRole Role;
	private String RealName;
	private String IDCardNoH;
	
	public long getAuID() {
		return auID;
	}
	public void setAuID(long auID) {
		this.auID = auID;
	}
	
	public String getStaffID() {
		return StaffID;
	}
	public void setStaffID(String StaffID) {
		this.StaffID = StaffID;
	}
	
	public UserGender getGender() {
		return Gender;
	}
	public void setGender(UserGender Gender) {
		this.Gender = Gender;
	}
	public void setGender(byte GenderCode) {
		this.Gender = UserGender.fromCode(GenderCode);
	}
	
	public UserRole getRole() {
		return Role;
	}
	public void setRole(UserRole Role) {
		this.Role = Role;
	}
	public void setRole(short RoleCode) {
		this.Role = UserRole.fromCode(RoleCode);
	}
	
	public String getRealName() {
		return RealName;
	}
	public void setRealName(String RealName) {
		this.RealName = RealName;
	}
	
	public String getIDCardNoH() {
		return IDCardNoH;
	}
	public void setIDCardNoH(String IDCardNoH) {
		this.IDCardNoH = IDCardNoH;
	}
	
	public AcceptableUser() {
		super();
	}
	
	public static AcceptableUser getDefaultEmpty() {
		AcceptableUser auser = new AcceptableUser();
		auser.auID = 0;
		auser.StaffID = "";
		auser.Gender = UserGender.Male;
		auser.Role = UserRole.Guest;
		auser.RealName = "";
		auser.IDCardNoH = "";
		return auser;
	}
    @Override
    public String toString() {
    	return this.RealName;
    }
    
    public JSON toJSON() {
    	return JSONSerializer.toJSON(this);
    }
}
